-
-
Notifications
You must be signed in to change notification settings - Fork 33k
gh-61206: Support zstandard compression in the zipimport module #138254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exciting! This would be really useful for compatibility if wheels can adopt using zstd in the future.
|
_importing_zstd = True | ||
try: | ||
from _zstd import ZstdDecompressor as _zstd_decompressor_class | ||
except Exception: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the rationale of catching all exceptions here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
matching the pattern of what the existing code did for zlib. realistically likely only an ImportError.
…pythonGH-138254) * pythongh-61206: support zstd in zipimport * NEWS entry * versionchanged doc
There's long been a request to support the alternate compression methods in
zipimport
. zstandard makes sense as it can either be fast or high compression.While we "could"... It is probably not worth the effort to do the same for bz2 or lzma zip entries in
zipimport
's implementation at this point.📚 Documentation preview 📚: https://cpython-previews--138254.org.readthedocs.build/